﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ssc
{
    class ErrorManager : SscLib.IErrorManager
    {
        int errorCount = 0;
        
        #region IErrorManager Members

        public void ReportError(string phase, string header, string message, string[] tokenNames, Exception e)
        {
            errorCount++;

            Console.Error.WriteLine("{0}: {1} {2}", phase, header, message);
        }

        public void ReportError(string phase, int line, int pos, string msg)
        {
            errorCount++;
            Console.Error.WriteLine("{0}: Line({1}) Pos({2}): {3}", phase, line, pos, msg);
        }


        public bool HasError
        {
            get { return errorCount > 0; }
        }

        public int ErrorCount
        {
            get { return errorCount; }
        }

        #endregion
    }
}
